<?xml version="1.0" encoding="UTF-8" ?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
			    xmlns:ui="http://java.sun.com/jsf/facelets"
			    xmlns:h="http://java.sun.com/jsf/html"
			    xmlns:f="http://java.sun.com/jsf/core"
			    xmlns:ajax="http://java.sun.com/jsf/composite/components/ajax"    
			    template="./template/template_login.xhtml">
    
    <ui:define name="title">
       Generar Acumulado
    </ui:define>
    
    <ui:define name="content">
			<h:form id="acumuladoForm">				
				<f:event listener="#{cumulativeBean.fillDropDowns}" type="preRenderView" />							
				<h:panelGrid  cellspacing="1" border="0" width="200 px;" 
							  bgcolor="#CCCCC0" columns="4" columnClasses="etiqueta,etiqueta_campo,etiqueta,etiqueta_campo"							  
							  headerClass="titulocolumna" footerClass="columnadatoPar">
					
					<f:facet name="header">
						<h:outputText value="Generar Acumulado" />  
					 </f:facet>								
					
					<h:outputText value="Mes:" />
					<h:selectOneMenu id="mesId" value="#{cumulativeBean.month}"  styleClass="campo_texto" >
						<f:ajax render="@none" execute="@this" />
                        <f:selectItem itemValue="1" itemLabel="Enero" />
                        <f:selectItem itemValue="2" itemLabel="Febrero" />
                        <f:selectItem itemValue="3" itemLabel="Marzo" />
                        <f:selectItem itemValue="4" itemLabel="Abril" />
                        <f:selectItem itemValue="5" itemLabel="Mayo" />
                        <f:selectItem itemValue="6" itemLabel="Junio" />
                        <f:selectItem itemValue="7" itemLabel="Julio" />
                        <f:selectItem itemValue="8" itemLabel="Agosto" />
                        <f:selectItem itemValue="9" itemLabel="Septiembre" />
                        <f:selectItem itemValue="10" itemLabel="Octubre" />
                        <f:selectItem itemValue="11" itemLabel="Noviembre" />
                        <f:selectItem itemValue="12" itemLabel="Diciembre" />
					</h:selectOneMenu>
					
					<h:outputText value="A&#241;o:" />
					<h:selectOneMenu id="anioId" value="#{cumulativeBean.year}"  styleClass="campo_texto" >
						<f:ajax render="@none" execute="@this" />                        
                        <f:selectItem itemValue="2010" itemLabel="2010" />
                        <f:selectItem itemValue="2011" itemLabel="2011" />
                        <f:selectItem itemValue="2012" itemLabel="2012" />
                        <f:selectItem itemValue="2013" itemLabel="2013" />
                        <f:selectItem itemValue="2014" itemLabel="2014" />
                        <f:selectItem itemValue="2015" itemLabel="2015" />
                        <f:selectItem itemValue="2016" itemLabel="2016" />
                        <f:selectItem itemValue="2017" itemLabel="2017" />
                        <f:selectItem itemValue="2018" itemLabel="2018" />
                        <f:selectItem itemValue="2019" itemLabel="2019" />
                        <f:selectItem itemValue="2020" itemLabel="2020" />
					</h:selectOneMenu>	

					
					<f:facet name="footer">
						<h:panelGroup style="text-align:right">		  
						  <h:commandButton id="generarId" styleClass="boton" value="Generar" action="#{cumulativeBean.generateCumulativeAction}" >
						   	<f:ajax render=":messages tabla" onevent="showDateIndicator" />
						  </h:commandButton>
						</h:panelGroup>
					 </f:facet>
										
				</h:panelGrid>				
				<br />
				<ajax:ajax />
				<h:dataTable id="tabla" value="#{cumulativeBean.cumulativeList}" var="row"   
					headerClass="titulocolumna"
					bgcolor="#CCCCC0" width="570" cellpadding="2" cellspacing="1" border="0" 			
	    			rowClasses="columnadatoNon,columnadatoPar">
	
					<h:column>		
						<f:facet name="header">	</f:facet>											
						 	<h:commandLink action="#{cumulativeBean.deleteAction}" onclick="return confirm('¿Eliminar Acumulado?');">	
						 		<f:param name="id" value="#{row.id}" />	
						 		<h:graphicImage value="resources/images/eliminar.jpg" alt="Eliminar Acumulado" style="border:0;" />						 							 	
						 	</h:commandLink>						 			
					</h:column>
					
					<h:column>
						<f:facet name="header"><h:outputText value="Mes" styleClass="ligas" /></f:facet>
						#{row.month}
					</h:column>
					
					<h:column>		
						<f:facet name="header"> <h:outputText value="A&#241;o:" styleClass="ligas" /></f:facet>		
						#{row.year}
					</h:column>
															
					<h:column>		
						<f:facet name="header"> <h:outputText value="Monto" styleClass="ligas" /></f:facet>		
						#{row.amount}
					</h:column>							
							
				</h:dataTable> 
				<br />							
			</h:form>			
	</ui:define>
    
</ui:composition>